package com.example.exam.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.exam.entity.pojo.Option;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author zhang
 */
@Mapper
public interface OptionMapper extends BaseMapper<Option> {
    @Insert("<script>" +
            "insert into option (id,text,img) values " +
            "<foreach collection='options' item='option' separator=','> " +
            "(#{option.id},#{option.text},#{option.img}) " +
            "</foreach>" +
            "</script>")
    Integer insertOptionList(List<Option> options);
}
